# (C) Datadog, Inc. 2023-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)


def test_list_versions(ddev, helpers, network_replay):
    network_replay('list_versions/success_disk.yaml', record_mode='none')

    result = ddev('release', 'list', 'disk')

    assert result.exit_code == 0, result.output
    assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
        """
        2.0.1
        2.1.0
        2.2.0
        2.3.0
        2.4.0
        2.5.0
        2.5.1
        2.5.2
        2.5.3
        2.6.0
        2.7.0
        2.8.0
        2.9.0
        2.9.1
        2.10.0
        2.10.1
        2.11.0
        3.0.0
        4.0.0
        4.1.0rc1
        4.1.0
        4.1.1
        4.2.0
        4.3.0
        4.4.0
        4.5.0
        4.5.1
        4.5.2
        4.6.0
        4.7.0
        4.7.1
        4.8.0
        4.9.0
        """
    )


def test_list_versions_header(ddev, helpers, network_replay):
    network_replay('list_versions/success_datadog_checks_base.yaml', record_mode='none')

    result = ddev('release', 'list', 'datadog_checks_base')

    assert result.exit_code == 0, result.output
    assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
        """
        4.7.0rc1
        5.0.1
        5.1.0
        5.2.0
        6.0.0
        6.1.0
        6.2.0
        6.3.0
        6.4.0
        6.5.0
        6.6.0
        7.0.0
        8.0.0
        8.1.0
        8.2.0
        8.3.0
        8.3.1
        8.3.2
        8.3.3
        8.4.0
        8.4.1
        8.5.0
        8.6.0
        9.0.0
        9.1.0
        9.2.0
        9.2.1
        9.3.0
        9.3.1
        9.3.2
        9.4.0
        9.4.1
        9.4.2
        9.5.0
        9.6.0
        10.0.0
        10.0.1
        10.0.2
        10.1.0
        10.2.0
        10.2.1
        10.3.0
        10.3.1
        11.0.0
        11.1.0
        11.2.0
        11.3.0
        11.3.1
        11.4.0
        11.5.0
        11.6.0
        11.7.0
        11.8.0
        11.9.0
        11.10.0
        11.11.0
        11.11.1
        11.12.0
        12.0.0
        13.0.0
        13.1.0
        14.0.0
        14.0.1
        15.0.0
        15.1.0
        15.2.0
        15.3.0
        15.4.0
        15.5.0
        15.6.0
        15.6.1
        15.7.0
        15.7.1
        15.7.2
        16.0.0
        16.1.0
        16.2.0
        16.3.0
        16.3.1
        16.3.2
        16.4.0
        16.5.0
        16.6.0
        16.6.1
        16.7.0
        16.8.0
        16.9.0
        17.0.0
        18.0.0
        18.1.0
        18.2.0
        18.3.0
        19.0.0
        19.2.0b1
        20.0.0
        20.0.1
        20.1.0
        20.2.0
        21.0.0
        21.0.1
        21.1.0
        21.2.0
        21.2.1b1
        21.2.1
        21.3.0
        22.0.0
        23.0.0
        23.1.0
        23.1.1
        23.1.2
        23.1.3
        23.1.4
        23.1.5
        23.2.0
        23.3.0
        23.3.1
        23.3.2
        23.3.3
        23.4.0
        23.5.0
        23.6.0
        23.7.0
        23.7.1
        23.7.2
        23.7.3
        23.7.4
        23.7.5
        23.7.6
        23.7.7
        24.0.0
        25.0.0
        25.0.1
        25.1.0
        25.2.0b1
        25.2.0
        25.2.1
        25.2.2
        25.3.0
        25.3.1
        25.4.0
        25.4.1
        25.4.2b1
        25.4.2
        25.5.0
        25.5.1
        25.6.0
        26.0.0
        27.0.0
        27.1.0
        27.2.0
        27.3.0
        27.3.1
        27.4.0
        27.4.1
        27.4.2
        27.5.0b1
        27.5.0
        28.0.0
        28.0.1
        29.0.0
        30.0.0
        30.0.1
        30.0.2
        30.1.0
        30.2.0
        31.0.0
        31.0.1
        31.0.2
        32.0.0
        32.1.0
        32.2.0
        32.3.0
        32.3.1
        """
    )
